luci-mod-system, luci-mod-status: permit sysupgrade --create-backup and legacy iptables-save - #8947
luci-mod-system, luci-mod-status: permit sysupgrade --create-backup and legacy iptables-save#8947JuliusBairaktaris wants to merge 2 commits into
Conversation
|
@jow- — review ping. One-line ACL grant permitting exactly Needed by openwrt/cgi-io#6, which is in turn needed by openwrt/openwrt#24558. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 2 new commits. Both commit messages match their diffs, both files stay valid JSON, and the ACL strings are in the correct read sections. Two inline notes — the main one is a question about whether rpcd's file.exec can actually carry a backup tarball, since it is fully buffered and returns stdout as a NUL-terminated string.
Generated by Claude Code
openwrt/cgi-io#6 moves archive creation to rpcd's file exec method so that it keeps working when uhttpd runs as a non-root user, and openwrt/rpcd#40 returns the child's stdout as a file descriptor so the archive is streamed rather than buffered into the ubus reply. rpcd matches the requested command against the caller's session ACL, so the grant names the exact command line. Depends on openwrt/cgi-io#6 and openwrt/rpcd#40. Assisted-by: Claude:claude-opus-5 Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Only the non-legacy iptables-save pair is in the session ACL, but the firewall status page runs the legacy pair when those binaries exist. Assisted-by: Claude:claude-opus-5 Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
7b773aa to
b63385b
Compare
The firewall status page runs the legacy iptables-save pair whenever those binaries
exist, and only the non-legacy pair is in the session ACL. The
.catch()covers afailed
stat(), so a device that carries the legacy binaries never falls back to thenon-legacy command.
cgi-io matches the requested command against the caller's session ACL and refuses the
exec.
handleCgiIoReply()inluci-base/htdocs/luci-static/resources/fs.jsturns the403 into a
PermissionErrorandL.resolveDefault(..., '')turns that into an emptystring, so the legacy tables come back empty. The luci-mod-status half is a fix against
current master on its own.
The luci-mod-system half only takes effect once openwrt/cgi-io#6 lands. On cgi-io
master the archive is created by cgi-io itself, gated on the
cgi-io backupscope andnot on a file exec grant, so the new entry is unused today.
openwrt/cgi-io#6 moves that exec to rpcd's file method so it keeps working when uhttpd
runs as a non-root user (openwrt/openwrt#24740), and openwrt/rpcd#40 returns the
child's stdout as a file descriptor so the archive is streamed. rpcd matches on the
command line, so the grant names the exact string, the same form as the
/sbin/sysupgrade --list-backupentry already in that ACL. Both PRs are still open.Depends on openwrt/cgi-io#6 and openwrt/rpcd#40.
I used AI to help me write the change. The empty-table behaviour is read from the
code chain above; I have not reproduced it on a device. Should the luci-mod-status
commit go in on its own now, since it fixes current master, and the
luci-mod-system one wait for cgi-io#6?